Pass deployment target to cc linker with -m*-version-min=#136333
Pass deployment target to cc linker with -m*-version-min=#136333madsmtm wants to merge 1 commit intorust-lang:mainfrom
-m*-version-min=#136333Conversation
Clang supports many ways of passing the deployment target, and prefers that you use the `-target` flag for doing so. This works poorly work with configuration files and Zig CC though, so we use the older `-mmacosx-version-min=`, `-miphoneos-version-min=`, `-mtargetos=` etc. flags to pass the deployment target instead.
|
r? compiler |
|
See rust-lang/cc-rs#1339 (comment); the cc-rs change may need to be improved. |
Yeah, the |
|
The related @rustbot author |
|
@madsmtm Any update on this PR? Thanks for your contribution. |
|
☔ The latest upstream changes (presumably #139037) made this pull request unmergeable. Please resolve the merge conflicts. |
|
No update, I'll try to get back to it, but I need to think a bit to ensure that this is the right approach. |
|
@madsmtm any further updates on this? or may be not a bad idea to close this and rework it whenever you have the time and motivation in a new pr |
Clang supports many ways of passing the deployment target, and prefers that you use the
-targetflag for doing so. This, however, works poorly work with Clang configuration files (at least before llvm/llvm-project#111387) and Zig CC.To support GCC, we already passed the deployment target using the older, more widely supported
-arch+-mmacosx-version-min=flag combination when compiling for macOS; let's do a similar thing for the other Apple targets too using-miphoneos-version-min=,-mtargetos=etc.Note that when passing the target triple to the LLVM backend, we still have to merge the deployment target into that.
See also the similar fix in
cc-rswhere the problem is more prominent, exactly because we did not already do it for macOS.@rustbot label O-apple
r? compiler
CC @thomcc @BlackHoleFox